<template>
  <!--查看学生信息-->
    <div class="components_table_details">
        <el-dialog width="1000px" title="学生信息"  :visible.sync="state" :show-close="true" :close-on-click-modal="false" class="maxheight">
          <table class="el-table el-table--fit el-table--striped el-table--border el-table--enable-row-transition ">
            <tbody class="el-table__body">
              <tr>
                <td width="130px"><label>学号：</label></td>
                <td width="300px">{{studentInfo.studentNumber}}</td>
                <td width="130px"><label>学生姓名：</label></td>
                <td width="300px">{{studentInfo.name}}</td>
                <td width="130px"><label>性别：</label></td>
                <td width="300px">{{studentInfo.sexShow}}</td>
              </tr>

              <tr>
                <td><label>院校：</label></td>
                <td>{{studentInfo.schoolName}}</td>
                <td><label>院系：</label></td>
                <td>{{studentInfo.secondSchoolName}}</td>
                <td><label>专业：</label></td>
                <td>{{studentInfo.professionName}}</td>
              </tr>

              <tr>
                <td><label>班级：</label></td>
                <td>{{studentInfo.className}}</td>
                <td><label>文理科：</label></td>
                <td>{{studentInfo.professionTypeShow}}</td>
                <td><label>出生日期：</label></td>
                <td>{{studentInfo.birthday}}</td>

              </tr>

              <tr>
                <td><label>民族：</label></td>
                <td>{{studentInfo.nationShow}}</td>
                <td><label>政治面貌：</label></td>
                <td>{{studentInfo.politicsStatusShow}}</td>
                <td width="130px"><label>身份证号：</label></td>
                <td width="300px">{{studentInfo.idCard}}</td>
              </tr>
              <tr>



                <td><label>手机：</label></td>
                <td>{{studentInfo.phone}}</td>
                <td><label>电子邮件：</label></td>
                <td>{{studentInfo.email}}</td>
                <td><label>状态：</label></td>
                <td>{{studentInfo.statusShow}}</td>


              </tr>

              <tr>
                <td><label>籍贯：</label></td>
                <td colspan="5">{{studentInfo.nativePlace}}</td>
              </tr>

              <tr>
                <td><label>高考分数：</label></td>
                <td>{{studentInfo.examScore}}</td>

                <td><label>高中学校：</label></td>
                <td colspan="3">{{studentInfo.seniorHighSchool}}</td>



              </tr>
              <tr>
                <td><label>家长姓名：</label></td>
                <td>{{studentInfo.parentsName}}</td>
                  <td><label>家长电话：</label></td>
                <td colspan="3">{{studentInfo.parentsPhone}}</td>
              </tr>

              <tr>
                <td><label>家庭地址：</label></td>
                <td colspan="5">{{studentInfo.homeAddress}}</td>
              </tr>
              <tr>
                <td><label>备注：</label></td>
                <td colspan="5">{{studentInfo.remark}}</td>
              </tr>
            </tbody>
          </table>
          <div slot="footer" class="dialog-footer">
                <el-button @click="state = false"  size="mini">关 闭</el-button>
            </div>
        </el-dialog>
        <!-- 内容区域  结束 -->
        </div>
</template>
<script>
  import moment from 'moment'
  export default {
    data() {
      return {
        state:false,
        studentInfo:{
          studentNumber:null,
          name:null,
          idCard:null,
          sex:null,
          birthday:null,
          professionType:null,
          schoolId:null,
          secondSchoolId:null,
          professionId: null,
          classId:null,
          politicsStatus: null,
          parentsName: null,
          examScore:null,
          phone:null,
          seniorHighSchool: null,
          nation:null,
          parentsPhone:null,
          email: null,
          homeAddress: null,
          nativePlace: null,
          remark: null,
          status: null,
        }
      };
    },
    created(){
    },
    methods: {
      showDialog(id){
        let self = this;
        self.state = true;
        //获取详情
        self.getStudentInfo(id,
          (result)=>{
            // console.log(JSON.stringify(result));
            self.studentInfo = result;
            self.studentInfo.birthday = moment(result.birthday).format('YYYY-MM-DD');
          });
      },
      getStudentInfo(id,success){
        let self = this;
        self.axios(api.getStudentInfo+id)
          .then(function(response){
                success(response.data.data)
          });
      },
    }
  }
</script>

<style scoped>
  .demo-ruleForm{
    width:1000px;
  }
  .student-body {
    min-height: 545px;
    width: 100%;
    background: #fff;
    border-radius: 4px;
    padding: 15px;
  }
  .student-body .contents span {
    display: inline-block;
    width: 100px;
    margin-top: 10px;
    text-align: right;
  }
  .student-body .contents .spanInput {
    height: 26px;
    width: 206px;
    line-height: 26px;
    font-size: 12px;
    color: #cdcdcd;
    text-indent: 5px;
    border-radius: 15px;
    border: 1px solid #cdcdcd;
    box-sizing: border-box;
    outline: none;
  }

  .student-body .contents .sexSpan {
    width: 20px;
    padding-left: 20px;
  }
  .student-body .contents .sexSpans{
    width: 50px;
  }
  .student-body .contents .lableInput {
    position: absolute;
    top: 12px;
    left: 105px;
  }
  .student-body .contents
  .student-body .reti {
    width: 94px;
  }
  .student-body .inputs {
    width: 100%;
    height: 40px;
    padding-top: 20px;
  }
  .student-body .inputs > span {
    font-size: 12px;
    color: #333;
    padding-left: 1px;
  }

  .box_tit {
    border-bottom: 1px solid #e6e8ec;
    position: relative;
    padding: 4px 0 10px 30px;
    margin-top: 0;
    font-weight: bold;
    line-height: 16px;
  }
</style>
